import {NgModule} from '@angular/core';
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {RouterModule, Routes} from "@angular/router";
import {
  AdministratorListComponent,
  AdministratorModule, LayoutManageComponent, LayoutManageModule, LayoutRootComponent,
  LoginComponent as ManageLoginComponent,
  LoginModule as ManageLoginModule,
  RoleListComponent as ManageRoleListComponent, RoleModule as ManageRoleModule,
} from "geminis-ng-manage";
import {
  LayoutResourcesComponent,
  OrganizationListComponent,
  UserListComponent,
  LoginModule as UserLoginModule,
  LoginComponent as UserLoginComponent,
  RoleModule as ResourcesRoleModule,
  RoleListComponent as ResourcesRoleListComponent,
  OrganizationModule, UserModule, LayoutResourcesModule
} from "geminis-ng-resources";
import {StartWorkComponent} from "../../projects/geminis-ng-workflow/src/user/startWork/startWork.component";
import {Work2doComponent} from "../../projects/geminis-ng-workflow/src/user/work2do/work2do.component";
import {UserModule as UserWorkModule} from "../../projects/geminis-ng-workflow/src/user/user.module";
import {HistoryProcessComponent} from "../../projects/geminis-ng-workflow/src/manager/history/process/history-process.component";
import {ModelListComponent} from "../../projects/geminis-ng-workflow/src/manager/model/list/model-list.component";
import {ModelModule} from "../../projects/geminis-ng-workflow/src/manager/model/model.module";
import {InstanceModule} from "../../projects/geminis-ng-workflow/src/manager/instance/instance.module";
import {HistoryModule} from "../../projects/geminis-ng-workflow/src/manager/history/history.module";

const routes: Routes = [
  {path: '', component: UserLoginComponent},
  {path: 'manageLogin', component: ManageLoginComponent},
  {
    path: 'workflow-manage', component: LayoutResourcesComponent, children: [
      {path: 'model', component: ModelListComponent},
      {path: 'history', component: HistoryProcessComponent},
    ]
  },
  {
    path: 'workflow', component: LayoutResourcesComponent, children: [
      {path: 'startProcess', component: StartWorkComponent},
      {path: 'work2do', component: Work2doComponent},
    ]
  },
  {
    path: 'resources', component: LayoutResourcesComponent, children: [
      {path: 'organization', component: OrganizationListComponent},
      {path: 'user', component: UserListComponent},
      {path: 'role', component: ResourcesRoleListComponent},
    ]
  },
  {
    path: 'manage', component: LayoutManageComponent, children: [
      {path: 'administrator', component: AdministratorListComponent},
      {path: 'role', component: ManageRoleListComponent}
    ]
  }
];

@NgModule({
  declarations: [],
  imports: [
    RouterModule.forRoot(routes),

    UserLoginModule,

    BrowserAnimationsModule,
    LayoutManageModule,
    ManageLoginModule,
    AdministratorModule,
    ManageRoleModule,

    OrganizationModule,
    UserModule,
    ResourcesRoleModule,
    LayoutResourcesModule,

    ModelModule,
    UserWorkModule,
    InstanceModule,
    HistoryModule

  ],
  providers: [],
  bootstrap: [LayoutRootComponent]
})
export class AppModule {
}
